﻿using CaseManagerLibrary.Socket;
using PSDLib.Protocols;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace PSDServer.Protocols
{
    public class PDMHeartBeatProcessor : ServerMessageProcessor
    {
        public override void Run(PSDServerContext context, TcpClientState state, params object[] args)
        {
            var hb = (Message as PDMHeartBeatMessage).Heartbeart;
            hb.ManagerIP = (state.TcpClient.Client.RemoteEndPoint as IPEndPoint).Address.ToString();
            //hb.ManagerPort = (state.Socket.RemoteEndPoint as IPEndPoint).Port;

            context.UpdatePDMHeartbeat(hb);
        }
    }
}
